package com.masu.knows.faq.mapper;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.masu.knows.commons.model.Answer;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * <p>
 * Mapper 接口
 * </p>
 *
 * @author 沈传尚
 * @since 2021-12-07
 */
@Repository
public interface AnswerMapper extends BaseMapper<Answer> {

    /**
     * 根据问题id 查询该问题下的所有回答内容以及评论
     */
    List<Answer> findAnswersAndCommentsByQid(@Param("qid") Integer qid);


    /**
     * 修改问题的采纳状态
     */
    int updateAcceptStatus(@Param("answerId") Integer answerId, @Param("acceptStatus") Integer acceptStatus);






}
